package com.zjgsu.nftplatform.service.impl;

import cn.hutool.core.lang.Pair;
import cn.hutool.core.map.MapUtil;
import com.zjgsu.nftplatform.service.ConfigService;
import com.zjgsu.nftplatform.util.PostUtil;
import org.springframework.stereotype.Service;

/**
 * @author ahy231
 * @date 2022/5/4 20:46
 * @description
 */
@Service
public class ConfigServiceImpl implements ConfigService {

    private final PostUtil postUtil;

    public ConfigServiceImpl(PostUtil postUtil) {
        this.postUtil = postUtil;
    }

    @Override
    public String nftAddress(String address) {
        return postUtil.configPost(MapUtil.<String, String>of(
                Pair.of("method", "nftAddress"),
                Pair.of("address", address)
        ));
    }

    @Override
    public String purchaseAddress(String address) {
        return postUtil.configPost(MapUtil.<String, String>of(
                Pair.of("method", "purchaseAddress"),
                Pair.of("address", address)
        ));
    }
}
